/** @file MapButton.qml
@brief Special buttons used to manage the map navigation

@authorname \n
@licenseversion \n
@actualversion - @dateupdate

@licensenote
*/

import QtQuick 1.0
import "Theme.js" as JsObj

BorderImage {
    id: button

    signal objClicked

    source: objSubLoad.getIcon(); clip: true

    border { left: 10; top: 10; right: 10; bottom: 10 }
    width: objSubLoad.getWidth()
    height: objSubLoad.getHeight()

    // Shade is set over the button image when it is presed
    Rectangle { id: shade; anchors.fill: button; radius: 5; color: "black"; opacity: 0 }

    Text {
        id: buttonText

        anchors.centerIn: parent; anchors.verticalCenterOffset: -1
        font.pointSize: 14
        font.bold: true
        text: objSubLoad.getString();
        color: "#ffffff"; smooth: true
    }

    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: { button.objClicked(); }
    }

    // When button is pressed the shade changes
    states: State {
        name: "pressed"; when: mouseArea.pressed == true
        PropertyChanges { target: shade; opacity: .2 }
    }

}
